/*
 *  Copyright © 2011 by Rob Cash
 *
 *  Licensed under the Apache License, Version 2.0 (the "License");
 *  you may not use this file except in compliance with the License.
 *  You may obtain a copy of the License at
 *
 *       http://www.apache.org/licenses/LICENSE-2.0
 *
 *  Unless required by applicable law or agreed to in writing, software
 *  distributed under the License is distributed on an "AS IS" BASIS,
 *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *  See the License for the specific language governing permissions and
 *  limitations under the License.
 *
 * TagFacade.java
 *
 * Created on Jul 31, 2011 at 2:54:12 PM
 */
package org.robcash.apps.bookmarksync.provider.spi.delicious;

import java.util.Collection;

import org.robcash.apps.bookmarksync.BookmarkSyncException;
import org.robcash.apps.bookmarksync.vo.Bookmark;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import del.icio.us.beans.Tag;

/**
 * Facade for Delicious tags
 * @author Rob Cash
 */
public class TagFacade implements org.robcash.apps.bookmarksync.vo.Tag
{
    @SuppressWarnings("unused")
    private static final Logger LOG = LoggerFactory.getLogger(TagFacade.class);

    private final Tag tag;
    private final DeliciousServiceProvider provider;

    public TagFacade(final Tag tag, final DeliciousServiceProvider provider)
    {
        this.tag = tag;
        this.provider = provider;
    }

    @Override
	public String getName()
    {
        return tag.getTag();
    }

    @Override
	public String getDescription()
    {
        throw new UnsupportedOperationException("Not supported yet.");
    }

    @Override
	public Collection<Bookmark> getBookmarks() throws BookmarkSyncException
    {
        return provider.getBookmarksWithTag(this);
    }

    @Override
    public String toString()
    {
        return getName();
    }

}
